﻿<ProjectSetupUI:SetupDialogBase 
    x:Class="TfsWorkbench.ProjectSetupUI.QuickStartControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:UIElements="clr-namespace:TfsWorkbench.UIElements;assembly=TfsWorkbench.UIElements"
    xmlns:ProjectSetupUI="clr-namespace:TfsWorkbench.ProjectSetupUI"
    Height="239" 
    Width="450"
    >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/TfsWorkbench.UIElements;Component/Resources/ApplicationStyles.xaml"/>
                <ResourceDictionary Source="Resources/ProjectSetupTemplates.xaml" />
                <ResourceDictionary Source="/TfsWorkbench.UIElements;Component/Resources/CommandButtonStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Border>
        <DockPanel LastChildFill="False">
            <Grid DockPanel.Dock="Top">
                <StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Style="{DynamicResource CommandPanel}" HorizontalAlignment="Right">
                    <Button 
                        Click="ExecuteButton_Click" 
                        Style="{DynamicResource ApplyButtonStyle}" ToolTip="Apply setup parameters" 
                        />
                    <Button 
                        Command="{x:Static UIElements:CommandLibrary.CloseDialogCommand}"
                        CommandParameter="{Binding}"
                        CommandTarget="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
                        Style="{DynamicResource CloseButtonStyle}" 
                        ToolTip="Close"
                        IsCancel="True"
                        />
                </StackPanel>
                <TextBlock 
                    DockPanel.Dock="Top" 
                    Style="{StaticResource DialogCaptionStyle}"
                    Text="Quick Setup" 
                    />
            </Grid>
            <Border
                DockPanel.Dock="Top"
                Style="{DynamicResource DialogInnerBorderStyle}"
                >
                <DockPanel>
                    <TextBlock
                        DockPanel.Dock="Top"
                        Foreground="DarkRed"
                        Name="ValidationErrors"
                        />
                    <Grid DockPanel.Dock="Top" Height="138">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>

                        <TextBlock 
                            FontWeight="Bold" 
                            VerticalAlignment="Center">Project Name:</TextBlock>

                        <TextBox 
                            Grid.Column="1"
                            IsReadOnly="True" 
                            Style="{StaticResource GreyOutOnReadOnly}" 
                            Text="{Binding Mode=OneWay, Path=ProjectSetup.Name}" 
                            />

                        <TextBlock 
                            Grid.Row="1"
                            FontWeight="Bold" 
                            VerticalAlignment="Center"
                            Text="Project Start Date:" 
                            />

                        <DatePicker 
                            Grid.Column="1"
                            Grid.Row="1"
                            SelectedDate="{Binding ProjectSetup.StartDate}"
                            Name="ProjectStartDate"
                            />

                        <TextBlock 
                            Grid.Row="2"
                            FontWeight="Bold" 
                            VerticalAlignment="Center"
                            Text="Project End Date:" 
                            />

                        <DatePicker 
                            Grid.Row="2"
                            Grid.Column="1"
                            SelectedDate="{Binding ProjectSetup.EndDate}"
                            Name="EndDate"
                            />

                        <ContentControl
                            Grid.Row="3"
                            Grid.ColumnSpan="2"
                            Content="{Binding ProjectSetup.Teams}"
                            IsTabStop="False"
                            Margin="0,10,0,0"
                            ContentTemplate="{StaticResource TeamCollectionTemplate}"
                            >
                        </ContentControl>
                    </Grid>
                    <StackPanel Orientation="Vertical" DockPanel.Dock="Bottom" TextBlock.Foreground="DarkRed" VerticalAlignment="Bottom">
                        <TextBlock 
                            TextWrapping="Wrap" 
                            HorizontalAlignment="Center" 
                            Text="Note: This feature is intended for inital setup only." 
                            />
                        <TextBlock 
                            TextWrapping="Wrap" 
                            HorizontalAlignment="Center" 
                            Text="Right click on the project nodes for more options." 
                            />
                    </StackPanel>
                </DockPanel>
            </Border>

        </DockPanel>
    </Border>
</ProjectSetupUI:SetupDialogBase>
